package com.example.yuejian21.nongfusanquan.yuejian21.model;

import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Clubcoursebean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Couchbean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Couchcoursebean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Coursebean;
import com.example.yuejian21.nongfusanquan.yuejian21.service.CouchService;
import com.example.yuejian21.nongfusanquan.yuejian21.service.CourseService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Nongfusanquan on 2017-10-17.
 */

public class Couchmodel {
    private Retrofit retrofit;
    public Couchmodel(){
        //创建实例
        retrofit =new Retrofit.Builder()
                .baseUrl("http://10.0.2.2/yuejian14/index.php/API/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call<List<Couchbean>> getcouchlist(){
        CouchService trainService = retrofit.create(CouchService.class);
        return trainService.getCouchlist();
    }

    public Call<List<Couchcoursebean>> getcouchcourse(){
        CouchService trainService = retrofit.create(CouchService.class);
        return trainService.getCouchcourse();
    }

}
